<template>
	<view class="item">
		<view class="img">
			<image :src="item.imageUrl" mode=""></image>
			<text>最新</text>
		</view>
		<view class="content">
			<view class="upper">
				<view class="title ovh2">
					{{item.name}}
				</view>
				<view class="info">
					<image :src="item.teacharAvatar" mode=""></image>
					{{item.teachar}}
				</view>
			</view>
			<view class="bottom">
				<view class="price" v-if="item.free == 1">
					免费课程
				</view>
				<view class="price" v-else>
					￥{{item.salePrice}} <text>￥{{item.listPrice}}</text>
				</view>
				
				<view class="right">
					{{item.learnTotal}}人正在学 <text v-if="item.free == 0">限时优惠</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		props: {
			item: {
				default: {}
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.item {
		display: flex;

		.img {
			width: 176rpx;
			height: 212rpx;
			border-radius: 8rpx;
			position: relative;
			overflow: hidden;

			text {
				position: absolute;
				left: 0%;
				top: 0;
				background-color: #72C476;
				font-size: 24rpx;
				color: #fff;
				width: 80rpx;
				text-align: center;
				border-radius: 8rpx;
				line-height: 40rpx;
			}
		}

		.content {
			width: calc(100% - 176rpx);
			padding-left: 35rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;

			.title {
				font-weight: bold;
			}

			.info {
				display: flex;
				align-items: center;
				font-size: 28rpx;
				margin-top: 20rpx;

				image {
					width: 60rpx;
					height: 60rpx;
					border-radius: 50%;
					margin-right: 18rpx;
				}
			}

			.bottom {
				display: flex;
				align-items: center;
				justify-content: space-between;
				flex-wrap: wrap;
				font-size: 24rpx;
				color: #999;

				.price {
					color: red;
					font-weight: bold;
					font-size: 32rpx;

					text {
						font-size: 24rpx;
						color: #999;
						font-weight: normal;
						text-decoration: line-through;
					}
				}

				.right text {
					font-size: 24rpx;
					padding: 6rpx 10rpx;
					border: 2rpx solid $assist-color2;
					color: $assist-color2;
					border-radius: 100px;
					margin-left: 10px;
				}
			}
		}
	}
</style>